package com.hngy.educationaladministration.mapper;

import com.hngy.educationaladministration.entity.FileTable;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author: Deng JunHao
 * @Date: 2021-05-04
 * @Description:
 */
@Repository
public interface FileTableMapper {
    /**
     * 添加记录
     *
     * @param fileTable
     * @return
     */
    int addUrl(FileTable fileTable);

    /**
     * 学生获取所有记录
     *
     * @param sid
     * @return
     */
    List<FileTable> getAllBySid(Integer sid);

    /**
     * get info by id
     *
     * @param id
     * @return
     */
    @Select("select * from filetable where id = #{id}")
    FileTable getFileById(Integer id);

    @Delete("delete from filetable where id = #{id}")
    void delFileById(Integer id);

    @Select("select * from filetable where tid = #{tid}")
    List<FileTable> getAllByTid(Integer tid);
}
